package com.oauth2.entity;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.GenericGenerator;

/**
 * OauthAccessToken entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "oauth_access_token", schema = "public")
public class OauthAccessToken implements java.io.Serializable {

	// Fields

	private String id;
	private String refreshToken;
	private String clientId;
	private String userName;
	private String authenticationId;
	private Date createTime;

	// Constructors

	/** default constructor */
	public OauthAccessToken() {
	}

	/** full constructor */
	public OauthAccessToken(String refreshToken, String clientId,
			String userName, String authenticationId, Date createTime) {
		this.refreshToken = refreshToken;
		this.clientId = clientId;
		this.userName = userName;
		this.authenticationId = authenticationId;
		this.createTime = createTime;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false, length = 32)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "refresh_token")
	public String getRefreshToken() {
		return this.refreshToken;
	}

	public void setRefreshToken(String refreshToken) {
		this.refreshToken = refreshToken;
	}

	@Column(name = "client_id")
	public String getClientId() {
		return this.clientId;
	}

	public void setClientId(String clientId) {
		this.clientId = clientId;
	}

	@Column(name = "user_name")
	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Column(name = "authentication_id")
	public String getAuthenticationId() {
		return this.authenticationId;
	}

	public void setAuthenticationId(String authenticationId) {
		this.authenticationId = authenticationId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time", length = 13)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

}